; Basic let expression examples

; Simple let with one binding
(let ((x 5))
  x)

; Let with multiple bindings
(let ((x 10)
      (y 20))
  (+ x y))

; Let with expression in binding
(let ((x (+ 2 3)))
  (* x 2))

; Let with multiple body expressions (returns last value)
(let ((x 5))
  (display "x is: ")
  (display x)
  (newline)
  (* x 10))

; Let shadows outer variables
(define x 100)
(let ((x 5))
  (display "Inner x: ")
  (display x)
  (newline))
(display "Outer x: ")
(display x)
(newline)

; Let bindings can reference outer scope
(define outer 50)
(let ((inner (+ outer 25)))
  inner)

; Nested let expressions
(let ((x 5))
  (let ((x 10)
        (y x))
    (+ x y)))

; Let with arithmetic operations
(let ((a 10)
      (b 20)
      (c 30))
  (+ a (* b c)))

; Let with function calls
(let ((double (lambda (x) (* x 2))))
  (double 21))

; Empty let (no bindings)
(let ()
  42)

; Let binding evaluation order (parallel, not sequential)
(define x 100)
(let ((x 5)
      (y (+ x 10)))  ; Uses outer x (100), not the let x (5)
  y)